package cn.usian.controller;



import cn.usian.client.OrderClient;
import cn.usian.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("order")
public class OrderController {

    //注入feign
    @Autowired
    private OrderClient orderClient;

    //分页查询
    @GetMapping("findPage")
    public String findPage(@RequestParam(required = true, defaultValue = "1") Integer pageIndex, String name) {
        String page = orderClient.findPage(pageIndex, name);
        return page;
    }

    //删除
    @GetMapping("del")
    public String del(Integer id) {
        return orderClient.del(id);
    }

    //添加
    @PostMapping("add")
    public String add(@RequestBody User user) {
        return orderClient.add(user);
    }




}
